multi_joint_link Derived Type

type, public, extends(link) :: multi_joint_link

Defines a link carrying an arbitrary number of joint coordinate frames. This type is suitable for the ternary and higher-order links found in closed-loop mechanisms.


Contents


Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: cg(3)

The x-y-z location of the CG relative to the body coordinate frame.

real(kind=real64), public :: inertia(3,3)

The 3-by-3 inertia tensor as measured about the CG of the body.

real(kind=real64), public :: mass

The mass of the body.


Constructor

public interface multi_joint_link

  • private function mjl_init(frames, mass, inertia, cg) result(rst)

    Initializes a new multi_joint_link instance.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:,:) :: frames

    A 4-by-4-by-N array containing the transformation matrix for each of the N joint coordinate frames. Each matrix maps coordinates from the corresponding joint frame into the link's body frame.

    real(kind=real64), intent(in), optional :: mass

    The mass of the link. If no value is specified, a value of 1 is used.

    real(kind=real64), intent(in), optional :: inertia(3,3)

    The 3-by-3 inertia tensor. If not specified, an identity matrix is used.

    real(kind=real64), intent(in), optional :: cg(3)

    The x-y-z location of the CG relative to the link's body coordinate frame. If not supplied, the CG is set to (0, 0, 0).

    Return Value type(multi_joint_link)

    The resulting multi_joint_link object.


Type-Bound Procedures

procedure, public :: get_joint_count => mjl_get_joint_count

  • private pure function mjl_get_joint_count(this) result(rst)

    Gets the number of joint coordinate frames carried by the link.

    Arguments

    Type IntentOptional Attributes Name
    class(multi_joint_link), intent(in) :: this

    The multi_joint_link object.

    Return Value integer(kind=int32)

    The number of joint coordinate frames.

procedure, public :: get_joint_frame => mjl_get_joint_frame

  • private pure function mjl_get_joint_frame(this, i) result(rst)

    Gets the transformation matrix relating the requested joint coordinate frame to the link's body coordinate frame.

    Arguments

    Type IntentOptional Attributes Name
    class(multi_joint_link), intent(in) :: this

    The multi_joint_link object.

    integer(kind=int32), intent(in) :: i

    The index of the joint coordinate frame (1 = first frame).

    Return Value real(kind=real64), (4,4)

    The resulting 4-by-4 transformation matrix.

procedure, public :: set_joint_frame => mjl_set_joint_frame

  • private subroutine mjl_set_joint_frame(this, i, x)

    Sets the transformation matrix relating the requested joint coordinate frame to the link's body coordinate frame.

    Arguments

    Type IntentOptional Attributes Name
    class(multi_joint_link), intent(inout) :: this

    The multi_joint_link object.

    integer(kind=int32), intent(in) :: i

    The index of the joint coordinate frame (1 = first frame).

    real(kind=real64), intent(in) :: x(4,4)

    The 4-by-4 transformation matrix.